<!--
  ~ Copyright (c) 2001-2009, TIBCO Software Inc.
  ~ Use, modification, and distribution subject to terms of license.
  -->

<html>
  <head>
    <title>Application Monitor</title>

    <style type="text/css">
      pre.jsx_appmonitor { padding:0px; margin:0px; white-space:pre; font-family:monospace; }
      /* These colors should match the ones defined in ide.css for consistency. */
      pre.FATAL { color:#660099; }
      pre.ERROR { color:#990000; }
      pre.WARN { color:#996600; }
      pre.INFO { color:#000000; }
      pre.DEBUG { color:#444444; }
      pre.TRACE { color:#888888; }      
    </style>

    <script type="text/javascript" language="JavaScript">

      window.initMonitor = function() {
        if (window._jsxname)
          window.setName(window._jsxname);
      };

      window.setName = function(strName) {
        window.document.title = strName + " Application Monitor";
        window.document.getElementById("title").innerHTML = strName + " Application Monitor";
      };

      window.isFirstTime = function() {
        return typeof(this._hasappendedmsg) == "undefined";
      };

      window.appendMessage = function(strMessage, strClass) {
        this._hasappendedmsg = true;
        
        //append the new message to the 'content' block
        var content = window.document.getElementById("content");
        var scrollPane = content.parentNode;

        // Speed-up for IE6
        if (content.insertAdjacentHTML) {
          strMessage = String(strMessage).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");
          content.insertAdjacentHTML("beforeEnd",
              '<pre class="jsx_appmonitor ' + strClass+ '">' + strMessage + '</pre>');
        } else {
          var oElm = document.createElement("pre");
          oElm.className = "jsx_appmonitor" + (strClass ? (" " + strClass) : "");

          var tokens = strMessage.split(/\n/g);
          for (var i = 0; i < tokens.length; i++) {
            if (i > 0)
              oElm.appendChild(document.createElement("br"));
            oElm.appendChild(document.createTextNode(tokens[i]));
          }
          content.appendChild(oElm);
        }

        // scroll to last message
        // Doing this in a timeout helps performance significantly. 
        if (!window._scrollTOID &&
            (scrollPane.scrollTop >= content.lastChild.offsetTop - scrollPane.offsetHeight - 2 * content.lastChild.offsetHeight)) {
          window._scrollTOID = window.setTimeout(function() {
            window._scrollTOID = null;

            if (content.firstChild)
              scrollPane.scrollTop = content.lastChild.offsetTop;
          }, 200);
        }
      };

    </script>
  </head>
  <body onload="initMonitor();" class="jsx30window" RIGHTMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" TOPMARGIN="0">

    <div id="title" style='position:relative;float:left;font-size:10px;height:17px;width:100%;
      color:#000000;background-color:#ffffff;overflow:hidden;font-family:Verdana, sans-serif;z-index:2;
      font-weight:bold;text-align:left;padding-top: 1px; padding-left: 4px;border-bottom:dashed 1px #a8a8b5;'>Application Monitor</div>

    <div style='clear:left;position:absolute;font-size:11px;left:0px;top:0px;width:100%;height:100%;
      color:#000000;overflow:auto;font-family:Monaco, Courier, monospace;z-index:1;'>
      <div id="content" class='jsx30block' style='position:relative;font-size:11px;color:#000000;
        text-align:left;padding: 19px 4px 2px 4px;'>
      </div>
    </div>

  </body>
</html>
